<?php
include("../sql/connexionmysql.php");
$Rubrique = (mysql_fetch_array(mysql_query('SELECT titre,title FROM rubrique WHERE id = 8')));
$RubriqueName = $Rubrique['titre'];
$RubriqueTitle = $Rubrique['title'];

$id = intval($_POST['idPhoto']);

$Photo = mysql_fetch_array(mysql_query('SELECT * FROM galerie WHERE idGalerie = '. $id));

$PreviousPhoto = mysql_fetch_array(mysql_query('SELECT idGalerie FROM galerie WHERE idGalerie < '. $id .' ORDER BY idGalerie DESC LIMIT 1'));

$NextPhoto = mysql_fetch_array(mysql_query('SELECT idGalerie FROM galerie WHERE idGalerie > '. $id .' ORDER BY idGalerie LIMIT 1'));

$maxid = mysql_fetch_array(mysql_query('SELECT MAX(idGalerie) AS Max FROM galerie'));
$minid = mysql_fetch_array(mysql_query('SELECT Min(idGalerie) AS Min FROM galerie'));

?>
<?php if ($id != $minid['Min']) { ?><a OnClick="update_photos(<?php echo $PreviousPhoto['idGalerie']?>);update_buttons(<?php echo $PreviousPhoto['idGalerie']?>);" style="cursor:pointer;"><img src="images/menu/previousphoto.jpg" width="15" height="15" title="Photo Pr&eacute;c&eacute;dente"></a>&nbsp;
<?php } if ($id != $maxid['Max']) { ?><a OnClick="update_photos(<?php echo $NextPhoto['idGalerie']?>);update_buttons(<?php echo $NextPhoto['idGalerie']?>);" style="cursor:pointer;"><img src="images/menu/nextphoto.jpg" width="15" height="15" title="Photo Suivante"></a>&nbsp;
<?php } ?><a href="index.php?page=<?php echo $RubriqueName; ?>"><img src="images/menu/allphoto.jpg" width="15" height="15" title="Toutes les photos"></a>